<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <script src="/node_modules/@bugsnag/browser/dist/bugsnag.min.js"></script>
    <script type="text/javascript">
      var NOTIFY = decodeURIComponent(window.location.search.match(/NOTIFY=([^&]+)/)[1])
      var SESSIONS = decodeURIComponent(window.location.search.match(/SESSIONS=([^&]+)/)[1])
      var API_KEY = decodeURIComponent(window.location.search.match(/API_KEY=([^&]+)/)[1])
      Bugsnag.start({
        apiKey: API_KEY,
        endpoints: { notify: NOTIFY, sessions: SESSIONS },
        redactedKeys: [ 'stacktrace', 'secret' ]
      })
    </script>
  </head>
  <body>
    <script>
      Bugsnag.addMetadata('details', {
        stacktrace: [ 'a', 'b' ]
      })
      function handle () {
        Bugsnag.notify(new Error('sensitive?'), function (event) {
          event.setUser('21')
          event.addMetadata('user', { password: '123456', secret: 'don’t tell anyone' })
        })
      }

      handle()
    </script>
  </body>
</html>
